from typing import Optional
from datetime import datetime
from pydantic import BaseModel

class FlightBase(BaseModel):
    FlightNo: str
    DepartureAirportCode: str
    ArrivalAirportCode: str
    DepartureTime: datetime
    ArrivalTime: datetime
    PlaneModel: str
    Carrier: str
    Status: str
    BasePrice: float

    class Config:
        from_attributes = True

class FlightCreate(FlightBase):
    pass

class Flight(FlightBase):
    FlightId: int
    CreateTime: datetime
    UpdateTime: Optional[datetime] = None

    class Config:
        from_attributes = True 